{% extends "base.html" %}
{% block content %}
<form class="well form-search" action="/demo/stats/handle" method="post">
    <span>
        姓名：<input type="text" name="name" id="name" placeholder="输入员工姓名或者泡泡号" class="input-medium"/> 
        <input type="hidden" name="token" id="token" value={{ token }} />
    </span>
    <span class="span-left">
        性别：
        <select class="span1" name="gender" id="gender">
            <option value=""></option>
            <option value="M">男</option>
            <option value="F">女</option>
        </select>
    </span> 
    <span class='common'>
        组名：
        <select class="span2" name="deptid" id="deptname">
            <option value=""></option>
            <option value=1>营销组</option>
            <option value=2>销售&amp;网站组</option>
            <option value=3>运维支持组</option>
            <option value=4>综合组</option>
            <option value=5>未分组</option>
        </select>
    </span>
    <span class='common'><button type="submit" class="btn btn-primary btn-right">查询</button></span>
    <span class="help-block">查询员工信息以及部门信息等一些统计信息,默认查询部门统计信息。 <a href="/demo/query">返回</a></span>
</form>

<span class="help-block">{{ empty }}</span>

<table class="table table-hover table-striped" style="visibility:hidden; {{ empvisible }} ">
     <thead>
        <tr>
            <th>姓名</th>
            <th>性别</th>
            <th>POPO</th>
            <th>所属组</th>
            <th>组长</th>
        </tr>
    </thead>
    <tbody>
        {% for emp in emps %}
        <tr>
            <td>{{ emp.name }}</td>
            <td>{{ emp.gender }}</td>
            <td><a href="mailto:#">{{ emp.popo }}</a></td>
            <td>{{ emp.dept.dept_name }}</td>
            <td>{{ emp.dept.manager_name }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>


<table class="table table-hover table-striped" style="visibility:hidden; {{ deptvisible }} ">
    <thead>
        <tr>
            <th>组名</th>
            <th>组长</th>
            <th>人数</th>
        </tr>
    </thead>
    <tbody>
        {% for dept in depts %}
        <tr>
            <td>{{ dept.dept_name }}</td>
            <td>{{ dept.manager_name }}</td>
            <td>{{ dept.dept_id }}</td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% endblock %}

